package com.example;

import java.util.Scanner;
public class Day1Triangle {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        System.out.printf("Enter three point for a triangle:");
        double x1 = sc.nextDouble();
        double y1 = sc.nextDouble();
        double x2 = sc.nextDouble();
        double y2 = sc.nextDouble();
        double x3 = sc.nextDouble();
        double y3 = sc.nextDouble();
        double SideLength1= Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
        double SideLength2= Math.sqrt((x3-x2)*(x3-x2)+(y3-y2)*(y3-y2));
        double SideLength3= Math.sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
        double s = (SideLength1 + SideLength2 + SideLength3)/2;
        double area = Math.sqrt(s*(s-SideLength1)*(s-SideLength2)*(s-SideLength3));
        System.out.println("The area of the triangle is" + area);
    }
}